import { AxiosHeaders, AxiosRequestConfig, Canceler, Method } from 'axios';

export interface HttpAxiosConfig extends AxiosRequestConfig {
    showLoading?: boolean;
    noAuth?: boolean;
}

export interface AxiosSendRequestParam {
    method: Method;
    url: string;
    params?: Record<string, any>;
    headers?: AxiosHeaders;
    config?: HttpAxiosConfig;
}

export interface ApiMaps {
    [propName: string]: AxiosSendRequestParam;
}

export type CancelTokenItem = {
    cancel: Canceler;
    url: string;
};

export interface HttpResponseData<T> {
    code: number;
    data: T;
    message: string;
}